package org.gfix.binding;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.gfix.parser.FixParseFault;

/**
 * This class holds the binding state for a 
 * give message - There is one per message.
 * @author alan
 *
 */
public class FixBindingContext {

	private Object boundObject;
	private List<FixParseFault> errors;
	private List<FixParseFault> warnings;
	private Map<Object, Object> groupStates = new HashMap<Object,Object>();
	private FixBindingMetaData currentMetadata;
	
	public Object getBoundObject() {
		return boundObject;
	}
	
	public void addGroupState(Object key, Object state)
	{
		groupStates.put(key, state);
	}
	
	public Object getGroupState(Object key)
	{
		return groupStates.get(key);
	}
	
	public void removeGroupState(Object key)
	{
		groupStates.remove(key);
	}
	
	
	FixBindingMetaData getCurrentMetadata() {
		return currentMetadata;
	}

	void setCurrentMetadata(FixBindingMetaData currentMetadata) {
		this.currentMetadata = currentMetadata;
	}

	public void setBoundObject(Object boundObject) {
		this.boundObject = boundObject;
	}
	public List<FixParseFault> getErrors() {
		return errors;
	}
	public void setErrors(List<FixParseFault> errors) {
		this.errors = errors;
	}
	public List<FixParseFault> getWarnings() {
		return warnings;
	}
	public void setWarnings(List<FixParseFault> warnings) {
		this.warnings = warnings;
	}
	
	
}
